<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>金币录入管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			 $("#aa").html("<label>金币状态：</label>"+"<select name='status' id='status' >	"+  
				       " <option value=''>请选择</option>"+
			           " <option value='02'>打回</option>"+
			          "  <option value='03'>待发行</option>"+
			          " <option value='05'>作废</option>	" +
				     "<select>")
			
		var aa=	$("#goin_status").val();
		 $("#status").val(aa);	
		 
		 $("a[data-href='.menu3-103']",parent.document).parent().parent().children('li').attr('class','');
			$("a[data-href='.menu3-103']",parent.document).parent().attr('class','active');
		});		
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<!--  <ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/goldinput/goldcoin/">金币录入审核</a></li>
		<shiro:hasPermission name="goldinput:goldcoin:edit"><li><a href="${ctx}/goldinput/goldcoin/form">金币录入添加</a></li></shiro:hasPermission>
	</ul>-->
	<sys:message content="${message}"/>
	<form:form id="searchForm" modelAttribute="goldcoinWapper" action="${ctx}/goldinput/goldcoin/distributequery?branchId=${goldcoinWapper.branchid}" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		<ul class="ul-form">
			<li><label>金币名称</label>
				<form:input path="goldcoinname"  value="${goldcoinWapper.goldcoinname }" htmlEscape="false" maxlength="80" class="input-medium"/>
			    <input type="hidden" id="goin_status" value="${goldcoinWapper.status }" htmlEscape="false" maxlength="80" class="input-medium"/>
			</li>
			<li><label>金币所属活动</label>
				<form:input path="activityname" value="${goldcoinWapper.activityname }" htmlEscape="false" maxlength="5" class="input-medium"/>
			</li>
        	<li><label>领取时间段</label>
				<input name="goldcoincollectionstart" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${goldcoinWapper.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
			至
				<input name="goldcoincollectionend" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${goldcoinWapper.goldcoincollectionend}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
			</li>
			
		    <li><label>渠道</label>
				<form:input path="subchannel" value="${goldcoinWapper.subchannel }" htmlEscape="false" maxlength="5" class="input-medium"/>
			</li>
			
			<li><label>每页</label>
			<select id="pageSize" name="pageSize" class="input-small">
				<option value="20"    <c:choose><c:when test="${page.pageSize=='20'}">selected=true</c:when></c:choose>>20</option>
				<option value="100"   <c:choose><c:when test="${page.pageSize=='100'}">selected=true</c:when></c:choose>>100</option>
				<option value="500"   <c:choose><c:when test="${page.pageSize=='500'}">selected=true</c:when></c:choose>>500</option>
				<option value="1000"  <c:choose><c:when test="${page.pageSize=='1000'}">selected=true</c:when></c:choose>>1000</option>
			</select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th	class="sort-column goldcoinname">序号</th> 
				<th	class="sort-column goldcoinname">金币名称</th>
				<th	class="sort-column goldcoinactivity">金币所属活动</th>
				<th	class="sort-column goldcoindistributiontotalnumber">总个数</th>
				<th	class="sort-column goldcoindistributiontotalnumber">剩余个数</th>
				<th	class="sort-column goldcoindistributiontotalnumber">已发个数</th>
				<th	class="sort-column goldcoinvaliditystyle">有效时间</th>
				<th	class="sort-column goldcoincollectionstart">金币领取开始时间</th>
				<th	class="sort-column goldcoincollectionend">金币领取结束时间</th>	
				<th	class="sort-column status">状态</th>
				<shiro:hasPermission name="goldinput:goldcoin:edit">
				<th class="sort-column goldcoinname">操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="goldcoin"  varStatus="i"  >
			<tr>
			 	<td>
			 	${i.index+1}
				</td> 
				<td>
				<a href="${ctx}/goldinput/goldcoin/goldcoinforusers?goldcoinid=${goldcoin.goldcoinid}">${goldcoin.goldcoinname}</a>

				</td>

				<td>
				${goldcoin.activityname}

				</td>
				<td>
					${goldcoin.goldcoindistributiontotalnumber}
				</td>
				<td>
					${goldcoin.goldcoinsurplusnumer}
				</td>
				<td>
					${goldcoin.goldcoindistributionnumber}
				</td>
					<td>
				<c:if
				  test="${'01' eq goldcoin.goldcoinvaliditystyle}"><fmt:formatDate value="${goldcoin.goldcoinvaliditystart}" pattern="yyyy-MM-dd HH:mm:ss"/> 至      <fmt:formatDate value="${goldcoin.goldcoinvalidityend}" pattern="yyyy-MM-dd HH:mm:ss"/> </c:if>	
			<c:if
				  test="${'02' eq goldcoin.goldcoinvaliditystyle}"><fmt:formatDate value="${goldcoin.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/> 至      <fmt:formatDate value="${goldcoin.goldcoinvalidityend}" pattern="yyyy-MM-dd HH:mm:ss"/> </c:if>	
			<c:if
				  test="${'03' eq goldcoin.goldcoinvaliditystyle}">
				  <fmt:formatDate value="${goldcoin.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/> 至   
				<fmt:formatDate value="${goldcoin.goldcoininvalidity}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</c:if>
				</td>
				
				<td>
					<fmt:formatDate value="${goldcoin.goldcoincollectionstart}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${goldcoin.goldcoincollectionend}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>

				<td>
				<c:if
				  test="${'04' eq goldcoin.status}">发行/使用中</c:if>	
				  <c:if
				  test="${'06' eq goldcoin.status}">仅使用，停止发行</c:if>	
				
				</td>
				<shiro:hasPermission name="goldinput:goldcoin:edit">
				<td>
    				 <a href="${ctx}/goldinput/goldcoin/getGoinDistributionInfo?goldcoinid=${goldcoin.goldcoinid}">查看</a>	 
					 <a href="${ctx}/goldinput/goldcoin/import?goldcoinid=${goldcoin.goldcoinid}&branchId=${goldcoinWapper.branchid}">导入</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>